Journals
  Publication Years
  Keywords
Search within results Open Search
Please wait a minute...
For Selected: Toggle Thumbnails
Optimization of source code search based on multi-feature weight assignment
LI Zhen, NIU Jun, WANG Kui, XIN Yuanyuan
Journal of Computer Applications    2018, 38 (3): 812-817.   DOI: 10.11772/j.issn.1001-9081.2017082043
Abstract571)      PDF (968KB)(483)       Save
It is a precondition of achieving code reuse to search open source code accurately. The current methods based on keyword search only concern matching function signatures. Considering the source code comments on the semantic description of the method's function, a method based on keyword search was proposed, which took into account code comments. The features of code, such as function signatures and different types of comments, were identified from the generated abstract syntax tree of source code; the code features and query statements were transformed into vectors respectively, and then based on the cosine similarity between the vectors, the scoring mechanism of multi-feature weight assignment to the results was created. According to the scores, an ordered list of relevant functions was obtained that reflects the associations between code features in the functions and a query. The experimental results demonstrate that the accuracy of search results can be improved by using multiple code features with different weights.
Reference | Related Articles | Metrics